﻿using System;
using NUnit.Framework;
using System.Runtime.Caching;
using SDF.Core.Infrastructure;

namespace Nop.Core.Tests.Infrastructure
{
    [TestFixture]
    public class CacheTest
    {
        [Test]
        public void MemoryCacheTest()
        {
            var cache = new MemoryCache("cache1");
            cache.Remove("sdf123");
            var cache2 = new MemoryCache("cache2");
            var policy = new CacheItemPolicy();
            policy.AbsoluteExpiration = DateTime.Now + TimeSpan.FromMinutes(60);
            cache.Set(new CacheItem("key1", "data1"), policy);

            var obj = cache.Get("key1");
            Assert.IsNotNull(obj);

            var obj2 = cache2.Get("key1");
            Assert.IsNull(obj2);

            var cache3 = new System.Web.Caching.Cache();
            cache3.Remove("sdfs123");

        }

     
    }
}
